# 修改的地方为名字和启动命令
# 名字
process_name=sns_index
proc_id=`ps -ef|grep -i  $process_name|grep -v "grep"|awk '{print $2}'`
if [ ! -z  $proc_id ];then
    kill $proc_id
    echo "$process_name is killing ..."
    proc_id=`ps -ef|grep -i  $process_name|grep -v "grep"|awk '{print $2}'`
    sleep 2
    if [ ! -z  $proc_id ];then
          echo "$process_name kill failed"
          exit 1
    fi
fi
# 启动命令
nohup python3 sns_index.py > log.log &
sleep 1
proc_id=`ps -ef|grep -i  $process_name|grep -v "grep"|awk '{print $2}'`
echo "$process_name start at $proc_id"